package com.example.myui.activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.example.myui.R;
import com.example.myui.iml.SonicJavaScriptInterface;

public class WebActivity extends AppCompatActivity {

    private String DEMO_URL = "https://www.baidu.com";
//    private String DEMO_URL = "http://mc.vip.qq.com/demo/indexv3";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_web);
        findViewById(R.id.btn1).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(WebActivity.this, AgentWebActivity.class));
            }
        });
        findViewById(R.id.btn2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(WebActivity.this, JSCommunicationActivity.class));
            }
        });

        findViewById(R.id.btn3).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(WebActivity.this, VosSnoicActivity.class);
                intent.putExtra(VosSnoicActivity.PARAM_URL, DEMO_URL);
                Log.i("TAG", "onClick: " + DEMO_URL);
                intent.putExtra(VosSnoicActivity.PARAM_MODE, 1);
                intent.putExtra(SonicJavaScriptInterface.PARAM_CLICK_TIME, System.currentTimeMillis());
                startActivity(intent);
            }
        });

        findViewById(R.id.btn4).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(WebActivity.this,JSBridegeActivity.class ));
            }
        });

    }
}
